package cn.sz.hy.handler.top;

import org.eclipse.swt.widgets.Combo;

import cn.sz.hy.common.Globel;
import cn.sz.hy.event.top.FileOpenEvent;
import cn.sz.hy.logic.strategy.StrategyFactory;
import cn.sz.hy.logic.strategy.impl.XlsStrategy;
import cn.sz.hy.logic.strategy.vo.TableVo;

public class FixHeaderHandler extends FileOpenHandler {
	public FixHeaderHandler() {
		super();
	}

	@Override
	public void execute(FileOpenEvent event) {
		Combo executeList = (Combo) eBus.getComponent(Globel.EXECUTE_LIST_ID);
		if (executeList.getSelectionIndex() == -1) {
			executeList.select(0);
		}
		XlsStrategy xs = StrategyFactory.getStrategy(executeList
				.getSelectionIndex());
		TableVo vo = eBus.getTableVo(event.getTableType());
		if (vo == null) {
			return;
		}
		xs.getSheetItem(vo.getSheet(), vo, true);
		showHeaderList(event.getTableType(), vo, xs);
	}
}
